#include "Stack.h"

void TestPushAndPop(Stack* pst)
{
	StackInit(pst);
	StackPush(pst,1);
	printf("%d\n", StackTop(pst));
	StackPush(pst,2);
	printf("%d\n", StackTop(pst));
	StackPush(pst,3);
	printf("%d\n", StackTop(pst));
	StackPush(pst,4);
	printf("%d\n", StackTop(pst));

	printf("--------------------------------\n");
	printf("%d\n", StackTop(pst));
	StackPop(pst);
	printf("%d\n", StackTop(pst));
	StackPop(pst);
	printf("%d\n", StackTop(pst));
	StackPop(pst);
	printf("%d\n", StackTop(pst));
	StackPop(pst);
}

void TestOther(Stack * pst)
{
	StackInit(pst);
	StackPush(pst, 1);
	StackPush(pst, 2);
	StackPush(pst, 3);
	StackPush(pst, 4);
	//为空返回非0数字,非空则为0
	while(!StackEmpty(pst))
	{
		printf("%d And Size == %d\n", StackTop(pst), StackSize(pst));
		StackPop(pst);
	}
	StackDestroy(pst);
}

int main()
{
	Stack pst;
	/*TestPushAndPop(&pst);*/
	TestOther(&pst);
	return 0;
}
